<?php 
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
* Description of IndexController
*
*/

class Admin_MenuController extends Zend_Controller_Action
{

	public function init(){
		$registry = Zend_Registry::getInstance();
		$this->_db = $registry->get('db');
	}
	 
    public function indexAction()
    {
		$this->_helper->layout->setLayout('admin');
		Zend_Loader::loadFile('../application/admin/models/Menu.php');
        
		$menu_model = new Menu();
		$menu_arr = $menu_model->listMenuItems();
        
		$this->view->menu_arr = $menu_arr;        
    }
    
    public function additemAction()
    {
    	$this->_helper->layout->setLayout('admin');
    	Zend_Loader::loadFile('../application/admin/models/Menu.php');
    	
    	$menu_model = new Menu();
    	
    	$parent_arr = $menu_model->getParentItems();
    	$this->view->parent_arr = $parent_arr;
    }
}
?>
